import 'package:date_format/date_format.dart';

class DateUtil {
  static const List<String> formatDay = ["yyyy", "-", "mm", "-", "dd"];
  static const List<String> formatMonth = ["yyyy", "-", "mm"];
  static const List<String> formatYear = ["yyyy"];

  static String getCurrentDate({List<String> format = formatDay}) {
    DateTime now = DateTime.now();
    return formatDate(now, format);
  }

  static String subtractDate(Duration duration, {List<String> format = formatDay}) {
    DateTime now = DateTime.now();
    return formatDate(now.subtract(duration), format);
  }
}
